/**
 * 
 */
package com.vanstone.imgapp.api.img.services;

import java.util.List;
import java.util.Map;

import com.vanstone.common.ObjectDuplicateException;
import com.vanstone.fs.api.FileException;
import com.vanstone.fs.local.LocalFSFile;
import com.vanstone.imgapp.api.img.Category;

/**
 * @author shipeng <br />
 *         栏目业务API
 */
public interface CategoryService {

  public static final String SERVICE = "categoryService";

  /**
   * 添加栏目信息
   * 
   * @param categoryName
   * @param categoryNamePinyin
   * @param content
   * @param localImgFSFile
   * @return
   * @throws ObjectDuplicateException
   * @throws FileException
   */
  Category addCategory(String categoryName, String categoryNamePinyin, String content, LocalFSFile localImgFSFile) throws ObjectDuplicateException, FileException;

  /**
   * 更新栏目基本信息
   * 
   * @param id
   * @param categoryName
   * @param categoryNamePinyin
   * @param content
   */
  void updateBaseCategoryInfo(long id, String categoryName, String categoryNamePinyin, String content);

  /**
   * 更新栏目封面图片信息
   * 
   * @param id
   * @param localImgFSFile
   * @throws FileException
   */
  void updateCategoryCoverFileInfo(long id, LocalFSFile localImgFSFile) throws FileException;

  /**
   * 通过id获取栏目信息
   * 
   * @param id
   * @return
   */
  Category getCategory(long id);

  /**
   * 通过栏目名称获取栏目信息
   * 
   * @param categoryName
   * @return
   */
  Category getCategoryByName(String categoryName);

  /**
   * 通过量来排序
   * 
   * @param offset
   * @param limit
   * @return
   */
  List<Category> getCategories(long offset, long limit);

  /**
   * 通过量获取category
   * 
   * @return
   */
  long getTotalCategories();

  /**
   * @param ids
   * @return
   */
  Map<Long, Category> getCategoriesByIDsAsMap(List<Long> ids);

  /**
   * @param ids
   * @return
   */
  List<Category> getCategoriesByIDs(List<Long> ids);

}
